查询 Event 对象
通过 event
对象的 id
查询一个已创建的 event
对象。
返回
返回一个已存在的 event
对象或者一个错误,详见 错误。
定义
GET https://api.pingxx.com/v1/events/{EVENT_ID}
\Pingpp\Event::retrieve('EVENT_ID');
Event.retrieve({EVENT_ID});
Pingpp::Event.retrieve({EVENT_ID})
pingpp.event.retrieve({EVENT_ID});
pingpp.Event.retrieve('EVENT_ID')
pingpp.EventClient.get(EVENT_ID)
retrieve(String id)
请求示例
curl https://api.pingxx.com/v1/events/evt_lqVSy5gbL0A68pS8YKvJzdWZ \
-u sk_test_ibbTe5jLGCi5rzfH4OqPW9KC:
\Pingpp\Pingpp::setApiKey("sk_test_ibbTe5jLGCi5rzfH4OqPW9KC");
\Pingpp\Event::retrieve('evt_lqVSy5gbL0A68pS8YKvJzdWZ');
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Event.retrieve("evt_lqVSy5gbL0A68pS8YKvJzdWZ");
require "pingpp"
Pingpp.api_key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
Pingpp::Event.retrieve("evt_lqVSy5gbL0A68pS8YKvJzdWZ")
var pingpp = require('pingpp')('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
pingpp.event.retrieve(
"evt_lqVSy5gbL0A68pS8YKvJzdWZ",
function(err, event) {
}
);
import pingpp
pingpp.api_key = 'sk_test_ibbTe5jLGCi5rzfH4OqPW9KC'
pingpp.Event.retrieve('evt_lqVSy5gbL0A68pS8YKvJzdWZ')
import (pingpp "github.com/pingplusplus/pingpp-go")
Event, err := client.get("evt_lqVSy5gbL0A68pS8YKvJzdWZ")
try {
Event evt = Event.retrieve("evt_lqVSy5gbL0A68pS8YKvJzdWZ");
Console.WriteLine(evt);
} catch (Exception e) {
Console.WriteLine(e.Message.ToString());
}
返回示例
{
"id": "evt_lqVSy5gbL0A68pS8YKvJzdWZ",
"created": 1430915345,
"livemode": true,
"object": "event",
"data": {
"object": {
"id": "ch_ebT0y9iPGCKCL0aPy9X1WLmT",
"object": "charge",
"created": 1430915284,
"livemode": true,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_Xz9iXLn9ebX1SOe1",
"channel": "wx",
"order_no": "as223af2ds",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": [],
"time_paid": 1430915344,
"time_expire": 1431001684,
"time_settle": null,
"transaction_no": "1001680021201505060112980000",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_ebT0y9iPGCKCL0aPy9X1WLmT/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": [],
"credential": [],
"description": null
}
},
"pending_webhooks": 0,
"type": "charge.succeeded",
"request": "iar_0K8m90CCeDK8PabXD00yfTq"
}